package com.java3_9;

import java.util.Random;

public class Husband implements Runnable{

    private final Account account;

    //通过构造器将共享数据进行传入
    public Husband(Account account) {
        this.account = account;
    }

    @Override
    public void run() {
        Random r = new Random();
        while (true) {
            account.save(r.nextInt(10000)+100);
        }
    }
}
